program to interchange first and last element in given list

join shbcf.ru